home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / mslang / percba / percbar.h < prev   
Encoding:
C/C++ Source or Header  |  1994-04-30  |  1.5 KB  |  39 lines

  1. ///////////////////////////////////////////////////////////////////
  2. // class for a "percentbar"
  3.  
  4. class CPercentBar
  5. public:
  6.     CPercentBar();
  7.     CPercentBar( UINT nFrameID,             // ID of the frame
  8.                  UINT nTextID,              // ID of the static-text (may be 0)
  9.                  CWnd *pParent );           // the window (dialog) with the frame
  10.     ~CPercentBar();
  11.     
  12.     void SubclassDlgItem( UINT nFrameID,    // ID of the frame
  13.                           UINT nTextID,     // ID of the static-text (may be 0)
  14.                           CWnd *pParent );  // the window (dialog) with the frame
  15.     void SetColor( COLORREF crColor );      // set the color for the bar
  16.     void UpdatePercentBar( void );          // put this call into your "OnPaint" routine
  17.     void SetPercent( int nPercent );        // set new value and redraw bar
  18.     
  19. private:
  20.     CWnd     *m_pParent;        // the parent
  21.     CWnd     m_Frame;           // the frame
  22.     UINT     m_nFrameID;        // ID of frame
  23.     UINT     m_nTextID;         // ID of text
  24.     int      m_CurrentPercent;  // current percent value
  25.     float    m_fWidth;          // width of the frame
  26.     RECT     m_rBorder;         // dimensions of the frame
  27.     COLORREF m_Color;           // color
  28.     
  29.     // get the client-area
  30.     void GetSize( void );
  31.     
  32.     // get new position
  33.     int GetNewPos( int iPercent );
  34.  
  35.     // draw the bar
  36.     void DrawPercentBar( RECT &rDraw );
  37. };
  38.